{include file="public_head" /}

<!-- Select2 -->
<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<!-- chk_3 -->
<link href="/static/console/css/chk_3.css" rel="stylesheet" type="text/css"/>
<body class="nav-md">
<style>
    .form-group{margin-bottom:0}
    .form-horizontal .control-labe {padding-top: 0}
</style>
<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>订单详细管理</h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>查看订单
                                    <!--<small>different form elements</small>-->
                                </h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <div class="printArea">
                                    <style>
                                        .form-group{margin-bottom:0}
                                        .form-horizontal .control-labe {padding-top: 0}
                                    </style>
                                    <br/>
                                    <form class="form-horizontal form-label-left" enctype="multipart/form-data" action=""
                                          method="post" id="registerForm">

                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">订 单 号：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$item.shop_order_number}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">买家账号：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$item.username} {:input('car_number')}</div>
                                            </div>
                                        </div>
                                        <div class="form-group tc">
                                            <label class="control-label col-md-3">门店名称：</label>
                                            <div class="col-md-6" style="margin-top: 10px;">
                                                {if condition="(session('role_id') eq 1 || session('role_id') eq 2 ) && session('auding_status') eq 2"}
                                                <select onChange="update_order_shop()" name="shop_id" class="form-control" style="width: 300px;float: left;" tabindex="-1">
                                                    {foreach $shop_list as $key=>$vo }
                                                    <option value="{$vo.id}" {eq name='$item.shop_id|default=""' value='$vo.id' }selected{/eq}>{$vo.shop_title}</option>
                                                    {/foreach}
                                                </select>
                                                {else/}
                                                <input type="hidden" name="shop_id" value="{$item.shop_id}">
                                                {$item.shop_title}
                                                {/if}
                                            </div>
                                        </div>
                                        <script>
                                            function update_order_shop() {
                                                var id = "{:input('id')}";
                                                var shop_id = $('[name="shop_id"]').val();
                                                $.ajax({
                                                    url : '{:url("order/goods_shop_id")}',
                                                    data:{'id':id,'shop_id':shop_id},
                                                    dataType:'html',
                                                    success:function(data){
                                                        console.log(data);
                                                        data = JSON.parse(data);
                                                        console.log(data)
                                                        if(data.code == 200){
                                                            layer.msg('门店修改成功');
                                                        }else{
                                                            layer.msg(data.message);
                                                        }
                                                    }
                                                });
                                            }

                                        </script>

                                        <div class="form-group tc">
                                            <label class="control-label col-md-3 ">车牌号：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                {if condition="input('is_certification_text') neq '已认证'"}
                                                <input type="text" style="float: left; height: 34px; margin-right: 10px;" name="car_number" value="{$item.car_number}" {notempty name="$item.car_number"}readonly{/notempty} />{empty name="$item.car_number"}<a  class="btn btn-primary" onClick="car_number(this)">修改</a>{/empty}
                                                {else/}
                                                <div>{$item.car_number}</div>
                                                {/if}

                                            </div>
                                        </div>
                                        <script>
                                            function car_number(t) {
                                                var member_id = "{$item.member_id}";
                                                var v = $(t).prev().val();
                                                $.ajax({
                                                    type: "POST",
                                                    url: "{:url('member/car_number')}",
                                                    data: {id:member_id,car_number:v},
                                                    dataType: "json",
                                                    success: function(ret){
                                                        //ret == true == 1/*?*/
                                                        if(ret == true){
                                                            layer.msg(ret.message);
                                                            history.go(0);
                                                        }
                                                        else{
                                                            layer.msg(ret.message);
                                                            history.go(0);
                                                        }
                                                    }

                                                });
                                            }
                                        </script>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">(APP/小程序)：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{switch name="item.device"}
                                                    {case 1}APP{/case}
                                                    {case 2}小程序{/case}
                                                    {default /}无
                                                    {/switch}</div>
                                            </div>
                                        </div>

                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">是否认证：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{:input('is_certification_text')}</div>
                                            </div>
                                        </div>

                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">绩效订单：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>
                                                    {switch name="item.finance_order"}
                                                    {case 1}业务员订单{/case}
                                                    {case 2}二维码订单{/case}
                                                    {case 3}门店订单{/case}
                                                    {case 4}普通订单{/case}
                                                    {default /}-
                                                    {/switch}
                                                </div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">(线上/下)订单：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>
                                                    {switch name="item.order_online"}
                                                    {case 1}线上订单{/case}
                                                    {case 2}线下订单{/case}
                                                    {default /}-
                                                    {/switch}
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">下单/退款时间：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$item.create_time}{in name="$item.status" value="10,11,12"} / {$item.refund_create_time}{/in}</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">运费：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$item.freight}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">总金额：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$item.amount}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        {in name="$item.status" value="10,11,12"}
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">退款金额：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$refund.amount}-{switch name="$item.refund.type"}
                                                    {case 1}退款{/case}
                                                    {case 2}退货{/case}{/switch}</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">退款理由：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$refund.title}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">退款说明：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$refund.explain}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        {/in}
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">买家留言：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{$item.explain}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">支付方式：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{switch name="item.pay_way"}{case 1}线上{/case}{case 2}线下{/case}{/switch}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>

                                        <div class="form-group">
                                            <label class="control-label col-md-3 ">优惠券使用情况:</label>
                                            <div class="col-md-4">

                                                {if condition="$item.coupon_id gt 0"}
                                                <div style="margin-top: 8px;"> ID:{$item.coupon_id} 标题 : {$item.coupon_title}-满 : {$item.coupon_totol_price} 元 - {$item.coupon_price} 元</div>
                                                {elseif condition="$item.coupon_id eq 0 && $item.status eq 1 && $item.amount gt 0" /}
                                                <select {if condition="session('role_id') neq 1"} disabled{/if} onChange="use_coupon({$item.id},this.value,{$item.member_id})" name="shop_id123" class="select2_single form-control" style="width: 440px;float: left;" tabindex="-1">
                                                    <option value="0">请选择优惠券</option>
                                                    {volist name="member_coupon" id="vo"}
                                                    <option value="{$vo.id}" >{$vo.title}-满{$vo.total_price}元减{$vo.minus_price}元</option>
                                                    {/volist}
                                                </select>
                                                {/if}
                                            </div>
                                        </div>

                                        <script>
                                            function use_coupon(order_id,member_coupon_id,member_id) {

                                                if(member_coupon_id > 0){
                                                    $.ajax({
                                                        type: "POST",
                                                        url: "{:url('service_order/use_coupon_service')}",
                                                        data: {order_id:order_id,member_coupon_id:member_coupon_id,member_id:member_id},
                                                        dataType: "json",
                                                        success: function(ret){
                                                            //ret == true == 1/*?*/
                                                            if(ret.code == 200){
                                                                console.log(ret);
                                                                layer.msg('使用成功');
                                                                history.go(0);
                                                            }
                                                            else{
//                                                            layer.msg('失败');
//                                                            history.go(0);
                                                            }
                                                        }

                                                    });
                                                }else{
                                                    alert('失败');
                                                }
                                            }
                                        </script>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">配送方式：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{switch name="item.shipping"}{case 1}商家配送{/case}{case 2}到店自提{/case}{/switch}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">支付类型：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <div>{switch name="item.pay_type"}{case 1}微信{/case}{case 2}支付宝{/case}{default /}-{/switch}&nbsp;&nbsp;&nbsp;&nbsp;</div>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">收货地址详情：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                姓　　名：{$item.address_name}<br>
                                                手 机 号 ：{$item.address_phone}<br>
                                                地　　区：{$item.area_info}<br>
                                                详细地址：{$item.address}<br>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">订单状态：</label>
                                            <div class="col-md-1 " style="margin-top: 10px;">
                                                {switch name="item.status"}
                                                {case 1}未支付{/case}
                                                {case 2}已支付{/case}
                                                {case 3}已发货{/case}
                                                {case 4}已完成{/case}
                                                {case 5}待评价{/case}
                                                {case 10}退款中{/case}
                                                {case 11}退款成功{/case}
                                                {case 12}退款失败{/case}
                                                {case 20}已取消({$item.cancel_content}){/case}
                                                {/switch}
                                                <br/>
                                                {if condition="$item.status eq 2"}
                                                <input type="checkbox" name="status"  value="3" datatype="*" nullmsg="请选择已发货！" > 已发货
                                                {/if}

                                            </div>

                                        </div>


                                        <div class="divider-dashed"></div>

                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">包含商品：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <table width="80%" border="1" style="font-family: '微软雅黑';">
                                                    <tr align="center" style="font-size: 16px;">
                                                        <td>商品ID</td>
                                                        <td>商品图片</td>
                                                        <td>商品名称</td>
                                                        <td>商品规格</td>
                                                        <td>商品价格</td>
                                                        <td>购买数量</td>
                                                    </tr>
                                                    {volist name='item.goods_list' id='goods_list'}
                                                    <tr align="center">
                                                        <td>{$goods_list.goods_id|default=''}</td>
                                                        <td style="padding: 20px;"><img id="imgShow" src="__PUBLIC__/{$goods_list.thumb_img|default=''}"
                                                                                        width="100" height="100"
                                                                                        onerror="this.src='__STATIC__/images/default.png'"/></td>
                                                        <td>{$goods_list.title|default=''}</td>
                                                        <td>{$goods_list.attribute|default='无'}</td>
                                                        <td>{$goods_list.price|default=''}</td>
                                                        <td>{$goods_list.number|default=''}</td>
                                                    </tr>
                                                    {/volist}
                                                </table>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">是否开发票：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                {switch name="item.bill"}{case 1}开{/case}{case 2} 否{/case}{default /}{/switch}<br>
                                                {eq name="$item.bill" value="1"}
                                                发票类型：{switch name="item.bill_type"}{case 1}电子{/case}{case 2} 普通{/case}{case 3} 增值税{/case}{default /}{/switch}<br>
                                                发票抬头：{switch name="item.bill_header"}{case 1}个人{/case}{case 2} 单位{/case}{default /}{/switch}<br>
                                                发票内容：{$item.bill_content}<br>
                                                发票电话：{$item.bill_phone}<br>
                                                电子邮箱：{$item.bill_email}<br>

                                                {/eq}
                                            </div>
                                        </div>
                                        {in name="item.status" value="3"}
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">备注信息：</label>
                                            <div class="col-md-1 " style="margin-top: 10px;">
                                                <textarea type="text" placeholder="备注" style="width: 500px;height: 100px;"
                                                          class="form-control col-md-7 col-xs-12" name="explain">{$item.explain|default=''}</textarea>

                                            </div>
                                        </div>
                                        {/in}
                                        {if condition="strpos('11,10,12',(string)$item.status) !== false"}
                                        <div class="form-group tc">
                                            <label class="control-label col-md-3 ">退款审核记录：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <table width="100%" border="1" style="font-family: '微软雅黑';">
                                                    <tr align="center" style="font-size: 16px;">
                                                        <td>申请者</td>
                                                        <td>申请门店</td>
                                                        <td>审核状态</td>
                                                        <td>审核时间</td>
                                                        <td>失败原因</td>
                                                    </tr>
                                                    {volist name='refund_order_audit_records' id='goods_list'}
                                                    <tr align="center">
                                                        <td>{$goods_list.username|default=''}</td>
                                                        <td>{$goods_list.shop_title|default=''}</td>
                                                        <td>
                                                            {switch name="$goods_list.status"}
                                                            {case 11}审核成功{/case}
                                                            {case 12}审核失败{/case}
                                                            {/switch}
                                                        </td>
                                                        <td>{$goods_list.create_time|default=''}</td>
                                                        <td>{$goods_list.fail_explain|default=''}</td>
                                                    </tr>
                                                    {/volist}
                                                </table>
                                            </div>
                                        </div>
                                        {/if}

                                        {in name="item.status" value="10"}
                                        {if condition="$refund_button eq true"}
                                        <div class="form-group tc">
                                            <label class="control-label col-md-3 ">退款状态：</label>
                                            <div class="col-md-1 " style="margin-top: 10px;">
                                                <select name="status" class="form-control" style="width: 200px;float: left;" tabindex="-1" {in name='item.status' value='11,12'}disabled{/in}>
                                                <option value="11" {eq name='item.status' value='11'}selected{/eq}>申请退款成功</option>
                                                <option value="12" {eq name='item.status' value='12'}selected{/eq}>申请退款失败</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group dc">
                                            <label class="control-label col-md-3 ">未退款理由：</label>
                                            <div class="col-md-1 " style="margin-top: 10px;">
                                                <textarea type="text" placeholder="未退款理由,不填写留空" style="width: 500px;height: 100px;"
                                                          class="form-control col-md-7 col-xs-12" name="fail_explain">{$refund_find.message|default=''}</textarea>
                                                <div style="width:500px;clear: both">
                                                    <span style="font-size: 16px;color: red">注：只有在退款状态是退款失败的时候填写</span>
                                                </div>
                                            </div>
                                        </div>
                                        {/if}
                                        {/in}
                                        {if condition="strpos('2,3,4,5,6',(string)$item.status) !== false"}
                                        <div class="form-group service_people">
                                            <label class="control-label col-md-3 ">服务人员与提成：</label>
                                            <div class="col-md-7 " style="margin-top: 10px;">
                                                <table width="100%" border="1" style="font-family: '微软雅黑';">
                                                    <tr align="center" style="font-size: 16px;">
                                                        <td width="160">提成类型</td>
                                                        <td width="160">服务门店</td>
                                                        <td width="70">服务人员</td>
                                                        <!--<td width="">服务分类</td>-->
                                                        <td width="70">提成金额</td>

                                                        <td width="150">消费日期</td>
                                                        <td width="150">服务内容</td>
                                                        <td>是否同意</td>
                                                        <td>人员是否同意</td>
                                                        <td>岗位</td>
                                                        <td>批次</td>
                                                        {eq name=":session('auding_status')" value="2"}
                                                        <td>操作</td>
                                                        {/eq}
                                                    </tr>
                                                    {volist name='gift_assignor_records' id='vo'}
                                                    <tr align="center">
                                                        <td>{$vo.type|default=''}</td>
                                                        <td>{$vo.shop_title|default=''}</td>
                                                        <td>{$vo.name|default=''}</td>
                                                        <!--<td>{$vo.title|default=''}</td>-->
                                                        <td>{$vo.assignor_price|default=''}</td>
                                                        <td>{$vo.create_time|default=''}</td>
                                                        <td>{$vo.title|default=''}</td>
                                                        <td>{eq name="$vo.is_agree" value="1"}未同意{else/}已同意{/eq}</td>
                                                        <td>{eq name="$vo.is_assignor_agree" value="1"}未同意{else/}已同意{/eq}</td>
                                                         <td>{$vo.post_title|default=''}</td>
                                                         <td>{$vo.pici|default=''}</td>
                                                        {eq name=":session('auding_status')" value="2"}
                                                       
                                                        <td onClick="del({$vo.id})">删除</td>
                                                        {/eq}
                                                    </tr>
                                                    {/volist}
                                                </table>
                                            </div>
                                        </div>

                                        <div class="form-group service_people tc" >
                                            <label class="control-label col-md-3 ">服务人员销售提成：</label>
                                            <div class="col-md-6 ">
                                                <table class="table table-striped table-bordered table-hover" style="width: 100%">
                                                    <thead>
                                                    <th>提成类型</th>
                                                    <th>服务人员</th>
                                                    <th>服务内容</th>
                                                    <th>提成金额</th>
                                                    <th>操作</th>
                                                    <th>岗位</th>
                                                    <th>批次</th>
                                                    </thead>
                                                    <tbody id="fieldtr">
                                                    <tbody align="right">
                                                    <tr>
                                                        <td colspan="7"><a href="javascript:;" class="addNewTrgoods" title="新增一条">新增一条</a></td>
                                                    </tr>
                                                    </tbody>

                                                </table>
                                            </div>
                                        </div>
                                        <!--<div class="form-group service_people" id="service_people">-->
                                            <!--<label class="control-label col-md-3 ">服务人员服务提成：</label>-->
                                            <!--<div class="col-md-7 ">-->
                                                <!--<table class="table table-striped table-bordered table-hover">-->
                                                    <!--<thead>-->
                                                    <!--<th>提成类型</th>-->
                                                    <!--<th>服务人员</th>-->
                                                    <!--<th >服务分类</th>-->
                                                    <!--<th>服务内容</th>-->
                                                    <!--<th>服务金额</th>-->
                                                    <!--<th>创建时间</th>-->
                                                    <!--<th>操作</th>-->
                                                    <!--</thead>-->

                                                    <!--<tbody id="fieldtrr">-->

                                                    <!--</tbody>-->
                                                    <!--<tbody align="right">-->
                                                    <!--<tr>-->
                                                        <!--<td colspan="7"><a href="javascript:;" class="addNewTr" title="新增一条" >新增一条</a></td>-->
                                                    <!--</tr>-->
                                                    <!--</tbody>-->
                                                <!--</table>-->
                                            <!--</div>-->
                                        <!--</div>-->
                                        {/if}
                                        {if condition="$item.is_free_order eq 2"}
                                        <div class="form-group tc">
                                            <label class="control-label col-md-3 ">免费订单审核：</label>
                                            <div class="col-md-6 " style="margin-top: 10px;">
                                                <table class="table table-striped table-bordered table-hover">
                                                    <thead>
                                                    <tr><th>审核状态</th><th>一级审核</th><th>二级审核</th><th>三级审核</th></tr>
                                                    </thead>
                                                    <tbody>
                                                    <tr>
                                                        <td class="td0">
                                                            {switch name="$item.auding_status"}
                                                            {case 1}等待审核{/case}
                                                            {case 2}审核成功{/case}
                                                            {case 3}审核失败{/case}
                                                            {/switch}
                                                        </td>
                                                        <td class="td1">
                                                            {switch name="$item.auding_status1"}
                                                            {case 1}等待审核{/case}
                                                            {case 2}审核成功{/case}
                                                            {case 3}审核失败{/case}
                                                            {/switch}
                                                        </td>
                                                        <td class="td2">
                                                            {switch name="$item.auding_status2"}
                                                            {case 1}等待审核{/case}
                                                            {case 2}审核成功{/case}
                                                            {case 3}审核失败{/case}
                                                            {/switch}
                                                        </td>
                                                        <td class="td3">
                                                            {switch name="$item.auding_status3"}
                                                            {case 1}等待审核{/case}
                                                            {case 2}审核成功{/case}
                                                            {case 3}审核失败{/case}
                                                            {/switch}
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td>
                                                            {if condition="(session('role_id') eq 1 || session('role_id') eq 2 || session('role_id') eq 11) && ($item.auding_status eq 1 || $item.auding_status eq 3)"}
                                                            <input type="checkbox" id="checkbox41_{$item.id}" class="chk_3"
                                                                   value="{$item.auding_status1}" {eq name="item['auding_status1']" value="2"}checked{/eq} />
                                                            <label style="margin-left: 30px;margin-top: 5px;"
                                                                   onclick="auding_order({$item['id']},'auding_status1')"
                                                                   for="checkbox41_{$item.id}"></label>
                                                            {/if}
                                                        </td>
                                                        <td>
                                                            {if condition="session('role_id') eq 12 && $item.auding_status1 eq 2 && ($item.auding_status eq 1 || $item.auding_status eq 3)"}
                                                            <input type="checkbox" id="checkbox42_{$item.id}" class="chk_3"
                                                                   value="{$item.auding_status2}" {eq name="item['auding_status2']" value="2"}checked{/eq} />
                                                            <label style="margin-left: 30px;margin-top: 5px;"
                                                                   onclick="auding_order({$item['id']},'auding_status2')"
                                                                   for="checkbox42_{$item.id}"></label>
                                                            {/if}
                                                        </td>
                                                        <td>
                                                            {if condition="session('role_id') eq 13 && $item.auding_status2 eq 2 && $item.auding_status1 eq 2 && $item.auding_status eq 1"}
                                                            <input type="checkbox" id="checkbox43_{$item.id}" class="chk_3"
                                                                   value="{$item.auding_status3}" {eq name="item['auding_status3']" value="2"}checked{/eq} />
                                                            <label style="margin-left: 30px;margin-top: 5px;"
                                                                   onclick="auding_order({$item['id']},'auding_status3')"
                                                                   for="checkbox43_{$item.id}"></label>
                                                            {/if}
                                                        </td>

                                                    </tr>
                                                    </tbody>
                                                </table>

                                            </div>
                                        </div>
                                        <script>

                                            function auding_order(id,auding_status){
                                                var reason = $('[name="reason"]').val();
                                                $.ajax({
                                                    type: "POST",
                                                    url: "{:url('order/auding_order')}",
                                                    data: {id:id,auding_status:auding_status,reason:reason},
                                                    dataType: "json",
                                                    success: function(ret){
                                                        //ret == true == 1/*?*/
                                                        if(ret == 2){
                                                            console.log(ret);
                                                            layer.msg('审核成功');
                                                            history.go(0);
                                                        }
                                                        else{
                                                            layer.msg('等待审核');
                                                            history.go(0);
                                                        }
                                                    }

                                                });
                                            }
                                        </script>
                                        {if condition="($item.auding_status eq 1 || $item.auding_status eq 3)"}
                                        <div class="form-group tc">
                                            <div class="form-group">
                                                <label class="control-label col-md-3 ">失败原因：</label>
                                                <div class="col-md-6 ">
                                                    <textarea name="reason" rows="5" style="width: 300px;">{$item.reason|default=''}</textarea>
                                                </div>
                                            </div>
                                        </div>
                                        {/if}
                                        {/if}

                                </div>

                                <div class="form-group ">
                                    <label class="control-label col-md-3 " style="text-align: right">是否隐藏会员提成：</label>
                                    <div class="col-md-6 ">
                                        <label class="radio_box">
                                            <input type="radio" name="type" id="status_1" class="cartradio"
                                                   value="1"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default="1"' value='1' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_1"></label>
                                            <span>否</span>
                                            &nbsp;&nbsp;
                                        </label>
                                        <label class="radio_box">
                                            <input type="radio" name="type" id="status_2" class="cartradio"
                                                   value="2"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default=""' value='2' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_2"></label>
                                            <span>是</span>
                                            &nbsp;&nbsp;
                                        </label>
                                    </div>
                                </div>
                                <div style="clear: both"></div>
                                <div class="form-group">
                                    <label class="control-label col-md-3 " style="text-align: right">只保留提成：</label>
                                    <div class="col-md-6 ">
                                        <label class="radio_box">
                                            <input type="radio" name="type2" id="status_3" class="cartradio"
                                                   value="1"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default="1"' value='1' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_3"></label>
                                            <span>否</span>
                                            &nbsp;&nbsp;
                                        </label>
                                        <label class="radio_box">
                                            <input type="radio" name="type2" id="status_4" class="cartradio"
                                                   value="2"
                                                   datatype="*"
                                                   nullmsg="请选择会员卡类型！" errormsg="请选择会员卡类型！"
                                                   {eq name='item.type|default=""' value='2' }
                                                   checked
                                                   {/eq}
                                            >&nbsp;&nbsp;
                                            <label for="status_4"></label>
                                            <span>是</span>
                                            &nbsp;&nbsp;
                                        </label>
                                    </div>
                                </div>


                                <div class="form-group">
                                    <div class="col-md-6  col-md-offset-3">
                                        <!--{in name="$item.status" value="2"}-->
                                        <!--<button type="submit" class="btn btn-primary">提交</button>-->
                                        <!--{/in}-->

                                        {if condition="in_array(session('role_id'),['11','12','13']) eq false"}

                                        {if condition="$item.status eq 10 && $refund_button == true && strpos('5,7,8,9,10',(string)session('role_id')) !== false"}
                                        <button type="submit" class="btn btn-primary">退款申请</button>
                                        {/if}
                                        <button type="button"  class="btn btn-danger" id="btnPrint">打印文本区域</button>

                                        {in name="$item.status" value="50,1"}
                                        <a onClick="cancel({$item.member_id},{$item.id})" class="btn btn-primary">取消订单</a>
                                        {/in}
                                        {if condition="strpos('2,3,4,5',(string)$item.status) !== false"}
                                        <button type="submit" class="btn btn-primary">提交订单</button>
                                        {/if}

                                        <a type="button"  class="btn btn-primary" id="parentIframe">打印表格订单</a>
                                        {/if}
                                        <a type="reset" class="btn btn-success" onClick="history.go(-1)">返回</a>
                                        {if condition="$item.status eq 10 && session('role_id') eq 1"}
                                        <a onClick="tuikuan2({$item.id},11)" class="btn btn-primary">管理员退款成功</a>
                                        <a onClick="tuikuan2({$item.id},12)" type="submit" class="btn btn-primary">管理员退款失败</a>
                                        {/if}
                                    </div>
                                </div>
                                </form>
                                <script>
                                    $('#parentIframe').click(function(){
                                        layer.open({
                                            type: 2,
                                            area: ['100%', '100%'],
                                            fixed: false, //不固定
                                            maxmin: true,
                                            content: 'http://lihai.xmdonkey.com/index.php/console/order/update_dayin/id/'+"{:input('id')}"+'/is_certification_text/'+"{:input('is_certification_text')}"+"/car_number/"+"{:input('car_number')}"
                                        });
                                    });
                                </script>
                                <div class="row">

                                    <div class="x_content col-md-12 col-sm-12 col-xs-12">
                                        <div class="form-group">
                                            <label class="control-label col-md-3 "
                                                   style="text-align: right">会员付款码：</label>
                                            <div class="col-md-3 ">
                                                <input type="text" placeholder="线下扫码机获得" onchange="" {neq
                                                       name="$item.status" value="1" }disabled{/neq}
                                                class="form-control col-md-7 col-xs-12" name="auth_code"
                                                value="{$item.auth_code|default=''}" datatype="*" nullmsg="请填写运费金额"
                                                >
                                            </div>
                                            {eq name="$item.status" value="1"}
                                            <div class="col-md-6  col-md-offset-3">
                                                <a type="reset" class="btn btn-success" onClick="mic_w_pay()">微信支付</a>
                                                <a type="reset" class="btn btn-success" onClick="mic_a_pay()">支付宝支付</a>
                                                <input type="hidden" name="order_amount" value="{$item.amount}"/>
                                                <input type="hidden" name="order_number" value="{$item.shop_order_number}"/>

                                            </div>
                                            {/eq}
                                        </div>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <!-- /page content -->

        </div>

    </div>
</div>

{include file="public_foot" /}
<!-- validform -->
<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<!--select-->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<script>
    function tuikuan2(order_id,status){

        $(function(){
            var fail_explain = "";

            $.ajax({

                type: "POST",

                url: "{:url('index/order/tuikuan2')}",

                data: {status:status, id:order_id,fail_explain:fail_explain},

                dataType: "json",

                success: function(data){

                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg(data.message);
                        history.go(0);
//                                window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg(data.message);
                    }
                    //var html = '';

//                        $.each(data, function(commentIndex, comment){
//
//                            html += '<div class="comment"><h6>' + comment['username']
//
//                                + ':</h6><p class="para"' + comment['content']
//
//                                + '</p></div>';
//
//                        });
//
//                        $('#resText').html(html);

                }

            });

            /// });

        });
    } function tuikuan(order_id,status){

        $(function(){
            var fail_explain = $('[name="fail_explain"]').val();

            $.ajax({

                type: "POST",

                url: "{:url('index/order/tuikuan2')}",

                data: {status:status, id:order_id,fail_explain:fail_explain},

                dataType: "json",

                success: function(data){

                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg(data.message);
                        history.go(0);
//                                window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg(data.message);
                    }
                    //var html = '';

//                        $.each(data, function(commentIndex, comment){
//
//                            html += '<div class="comment"><h6>' + comment['username']
//
//                                + ':</h6><p class="para"' + comment['content']
//
//                                + '</p></div>';
//
//                        });
//
//                        $('#resText').html(html);

                }

            });

            /// });

        });
    }
    function mic_w_pay() {
        var auth_code = $("[name='auth_code']").val();
        var out_trade_no = $("[name='order_number']").val();
        var price = $("[name='order_amount']").val();

        if(!auth_code){
            layer.msg('付款码不能为空');
            return;
        }

        $.ajax({
            type: "POST",
            url: "{:url('mic/w_pay')}",
            data: {auth_code:auth_code, out_trade_no:out_trade_no,price:price},
            dataType: "json",
            success: function(ret){
                if(ret == true){
                    layer.msg('支付成功');
                    history.go(0);
                }
                else{
                    layer.msg('支付失败');
                }
            }

        });
    }

    function mic_a_pay() {

        var auth_code = $("[name='auth_code']").val();
        var out_trade_no = $("[name='order_number']").val();
        var price = $("[name='order_amount']").val();

        if(!auth_code){
            layer.msg('付款码不能为空');
            return;
        }

        $.ajax({
            type: "POST",
            url: "{:url('mic/a_pay')}",
            data: {auth_code:auth_code, out_trade_no:out_trade_no,price:price},
            dataType: "json",
            success: function(ret){
                if(ret == true){
                    layer.msg('支付成功');
                    history.go(0);
                }
                else{
                    layer.msg('支付失败');
                }
            }

        });
    }

    function mic_a_pay() {

        var auth_code = $("[name='auth_code']").val();
        var out_trade_no = $("[name='order_number']").val();
        var price = $("[name='order_amount']").val();

        if(!auth_code){
            layer.msg('付款码不能为空');
            return;
        }

        $.ajax({
            type: "POST",
            url: "{:url('mic/a_pay')}",
            data: {auth_code:auth_code, out_trade_no:out_trade_no,price:price},
            dataType: "json",
            success: function(ret){
                if(ret == true){
                    layer.msg('支付成功');
                    history.go(0);
                }
                else{
                    layer.msg('支付失败');
                }
            }

        });
    }
    function cancel(member_id,order_id){
        $(function(){
//            var member_id = member_id;
            //var order_id = order_id;
            //$('#send').click(function(){

            $.ajax({

                type: "POST",

                url: "{:url('index/order/cancel')}",

                data: {member_id:member_id, order_id:order_id},

                dataType: "json",

                success: function(data){

                    //  $('#resText').empty();   //清空resText里面的所有内容
                    //var obj = JSON.parse(data);
                    if(data.code == 200){
                        layer.msg('订单取消成功');
                        history.go(0);
                        window.location.href = "{:url('index')}"
                    }
                    else{
                        layer.msg('取消失败');
                    }
                    //var html = '';

//                        $.each(data, function(commentIndex, comment){
//
//                            html += '<div class="comment"><h6>' + comment['username']
//
//                                + ':</h6><p class="para"' + comment['content']
//
//                                + '</p></div>';
//
//                        });
//
//                        $('#resText').html(html);

                }

            });

            /// });

        });
    }
</script>
<script>
    function delThisTr(trobj)
    {
        trobj.parent().parent().remove();
    }
    function del(id) {


        $.ajax({
            type: "POST",
            url: "{:url('console/gift_order/delete')}",
            data: {id:id},
            dataType: "json",
            success: function(data){
                //  $('#resText').empty();   //清空resText里面的所有内容
                //var obj = JSON.parse(data);
                if(data.code == 200){
                    layer.msg('删除成功');
                    history.go(0);
                    //window.location.href = "{:url('index')}"
                }
                else{
                    layer.msg('取消失败');
                }

            }
        });
    }
    // validform
    $(function () {

        $.Tipmsg.r = null;

        var showmsg = function (msg) {
            //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
            alert(msg);
        }

        // select2
        $(".select2_single").select2({
            placeholder: "请选择快递公司",
            allowClear: true
        });

        $(".select2_single2").select2({
            placeholder: "请选择订单状态",
            allowClear: true
        });

        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true
        });



        function delThis(trobj,id)
        {
            if(confirm('确认删除？')){
                $.ajax({
                    url : '{:url("service_order/shop_assignor_records")}',
                    data:{'id':id},
                    dataType:'html',
                    success:function(data){
                        data = JSON.parse(data);
                        console.log(data)
                        if(data.code == 200){
                            layer.msg('删除成功');
                            trobj.parent().parent().remove();
                        }else{
                            layer.msg(data.message);
                        }
                    }
                });
            }
        }
        var assgioner = {$shop_assignor};
        console.log('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa');
        console.log(assgioner);
        var s = [];

        s = '<tr><td><select name="status" class="form-control" tabindex="-1">' + ss
        s += '</select></td>';
        console.log(s);
        var ss = [];
        $.each(assgioner, function(k,v){
            ss += '<option value="'+v.id+'">'+v.name+'</option>';
        });

        console.log('ABBBBBBBBBBBBBBBB');
        console.log(gift_c);
        var category = {$category};
        var cat_list;
        var repeat = '-';
        $.each(category, function(k,v){
            var dis;
            var price = '';
            if(v.count == 1 || v.count==2){ //1 2级
                dis = 'disabled';
            }else{
                price = '-'+v.price;
            }

            cat_list += '<option value="'+v.id+'-'+v.price+'"'+dis+'>'+'&nbsp&nbsp'.repeat(v.count)+'|--'+v.title+price+'</option>';
        });
        var gift_shop_content;
        $.each({$service_people_price2}, function(k,v){ //服务人员提成
            gift_shop_content += '<option value="'+v.id+'">'+v.cat_name+'</option>';
        });
		var ssss = [];//岗位
			var post_list = {$post_list};
            $.each(post_list, function(k,v){
                ssss += '<option value="'+v.id+'">'+v.shop_title+'--'+v.title+'</option>';
            });
//        $(".addNewTr").click(function(){
//            str =
//                '<tr><td><select name="typea[]" class="form-control select2_single" tabindex="-1"><option value="1">服务提成</option></select></td>' +
//                '<td><select name="assignor_id[]" class="form-control" tabindex="-1">' + ss +
//                '</select></td>' +
//                '<td><select name="single_id[]" onchange="single2(this.value,this)" class="form-control" tabindex="-1">' + gift_c +
//                '<td><select name="assignor_content[]" onchange="person_price(this.value,this)" class="form-control" tabindex="-1">' + gift_shop_content +
//                '<td><input name="assignor_price[]" readonly class="form-control" value="'+{$service_people_price2}[0]['price']+'" /></td>'+
//                '<td><a href="javascript:;" onclick="delThisTr($(this))">删除</a></td></tr>';
//            $("#fieldtrr").append(str);
//        });


        var gift_c_goods;
        $.each({$order_goods}, function(k,v){ //服务人员提成
            gift_c_goods += '<option value="'+v.goods_id+'">'+v.title+'</option>';
        });
        $(".addNewTrgoods").click(function(){
            var str = '<tr><td><select onchange="single_price_goods(this.value,this)" name="typea[]" class="form-control select2_single" tabindex="-1"><option value="2">售卖提成</option><option value="1">服务提成</option></select></td>' +
                '<td><select name="assignor_id[]" class="select2_single form-control" tabindex="-1"><option value=""></option>' + ss +
                '</select></td>' +
                '<td><select name="single_id[]" onchange="single22(this.value,this)" class="select2_single form-control" tabindex="-1">' + gift_c_goods +
                '<td><input name="assignor_price[]" readonly class="form-control" value="'+{$goods_price}+'" /></td>'+
                '<td><a href="javascript:;" onclick="delThisTr($(this))">删除</a></td>'+
				'<td id="post_id"><select name="post_id[]" onchange="gangwei_pirce(this.value,this)" class="select2_single form-control" tabindex="-1"><option value=""></option>' + ssss +
					'</select></td>'+
					'<td><input name="pici[]" readonly class="form-control" value="'+{$pici}+'" /></td>'+
					'</tr>';
            str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
            str +="<script>\n" +
                "                                        $(\".select2_single\").select2({\n" +
                "                                            placeholder: \"请选择分类\",\n" +
                "                                            allowClear: true\n" +
                "                                        });\n" +
                "                                    <\/script>";
            $("#fieldtr").append(str);
        });




//    $(".addNewTr").click(function(){
//        str =
//            '<tr><td><input type="text" name="assignor_id[]"  /></td>' +
//            '<td><input type="text" name="assignor_price[]"  /></td>' +
//            '<td><input type="text" name="assignor_content[]" /></td>' +
//            '<td><a href="javascript:;" onclick="delThisTr($(this))">删除</a></td></tr>';
//        $("#fieldtr").append(str);
//    });

        function delThisTrr(trobj)
        {
            trobj.parent().parent().remove();
        }

        function shop(id){
            $.ajax({
                url : '{:url("ajaxfenlei")}',
                data:{'shop_id':id},
                dataType:'json',
                success:function(data){
                    var str = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data+'" /></td>';
                    $(t).next().html(str);
                }
            });
        }


        var assgioner = {$shop_assignor};
        console.log(assgioner);
        var s = [];
        var ss = [];
        $.each(assgioner, function(k,v){
            ss += '<option value="'+v.id+'">'+v.name+'</option>';
        });

        s = '<tr><td><select name="status" class="form-control" tabindex="-1">' + ss
        s += '</select></td>';
        console.log(s);
        var gift_c;
        $.each({$service_people_price}, function(k,v){ //服务人员提成
            gift_c += '<option value="'+v.id+'">'+v.cat_name+'</option>';
        });
        var gift_shop_content;
        $.each({$service_people_price2}, function(k,v){ //服务人员提成
            gift_shop_content += '<option value="'+v.id+'">'+v.cat_name+'</option>';
        });
        $(".addNewTr").click(function(){
            str = '<tr><td><select name="typea[]"  class="form-control select2_single" tabindex="-1"><option value="1">服务提成</option></select></td>' +
                '<td><select name="assignor_id[]" class="form-control" tabindex="-1">' + ss +
                '</select></td>' +
                '<td><select name="single_id[]" onchange="singlea123(this.value,this)" class="form-control" tabindex="-1">' + gift_c +
                '<td><select name="assignor_content[]" onchange="person_price2(this.value,this)" class="form-control" tabindex="-1">' + gift_shop_content +
                '<td><input name="assignor_price[]" readonly class="form-control" value="'+{$service_people_price2}[0]['person_price']+'" /></td>'+
                '<td><input type="text" value="{:date('Y-m-d H:i:s',time())}" /></td>' +
            '<td><a href="javascript:;" onclick="delThisTr($(this))">删除</a></td></tr>';
            $("#fieldtrr").append(str);
        });





    })
</script>
<script>

    function single_price_goods(v,t) {

        var shop_id = $("[name='shop_id']").val();
        var single_id = $(t).parent().next().next().find('select').val();
        //1服务提成 2销售提成
        if(v == 2){
            $(t).parent().next().next().next().find('input').val({$goods_price});

        }else{
            $.ajax({
                url : '{:url("single/single_ajax_goods_shop_price1")}',
                data:{'shop_id':shop_id,'single_id':single_id},
                dataType:'json',
                success:function(data){
                    var str = [];
                    console.log(data);
                    $(t).parent().next().next().next().find('input').val(data);

                }
            });

        }

    }

    function person_price2(id,t) { //二级类获得字的价格
        var shop_id = $("[name='shop_id']").val();

        $.ajax({
            url : '{:url("single/ajax4a")}',
            data:{'id':id,'shop_id':shop_id},
            dataType:'json',
            success:function(data){
                console.log(data);
                var person_price = [];
                person_price = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data+'" /></td>';
                $(t).parent().next().html(person_price);
            }
        });
    }
	function gangwei_pirce(id,t) { //二级类获得字的价格
        var shop_id = $("[name='shop_id']").val();
		var assignor_content = $(t).parent().prev().prev().prev().find('select').val();
		var type_id =  $(t).parent().prev().prev().prev().prev().prev().find('select').val();
		var single_id = $(t).parent().prev().prev().prev().find('select').val();
		var type ='2';
		var order_id = '{:input('id')}';
		console.log(single_id);
		/*******
		 $.ajax({
                url : '{:url("single/single_ajax_goods_shop_price1")}',
                data:{'shop_id':shop_id,'single_id':single_id},
                dataType:'json',
                success:function(data){
                    var str = [];
                    console.log(data);
                    $(t).parent().prev().prev().find('input').val(data);

                }
            });
		/***************/
		
		var yuan_ticheng =$(t).parent().prev().prev().find('input').val();
		

		$.ajax({
               url : '{:url("single/ajax5")}',
               data:{'id':id,'shop_id':shop_id,'order_id':order_id,'yuan_ticheng':yuan_ticheng,'assignor_content':assignor_content,'type':type,'type_id':type_id},
               dataType:'json',
               success:function(data){
               console.log(data);
               var person_price = [];
               person_price = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data+'" /></td>';
               $(t).parent().prev().prev().html(person_price);
			   $(t).parent().prev().prev().find('input').val(data);
               }
         });		
		
		
		
       
    }
    function singlea123(id,t) {
        var shop_id = $("[name='shop_id']").val();

        $.ajax({
            url : '{:url("single/ajax2a")}',
            data:{'single_id':id,'shop_id':shop_id},
            dataType:'json',
            success:function(data){
                var str = [];

                console.log(data);
                str = '<select name="assignor_content[]" onchange="person_price2(this.value,this)" class="select2_single form-control" tabindex="-1">';
                $.each(data, function(k,v){
                    str += '<option value="'+v.id+'">'+v.cat_name+'</option>';
                });
                str += '</select>';
                str += '<script src="__STATIC__\/js\/select\/select2.full.min.js"><\/script>';
                str +="<script>\n" +
                    "                                        $(\".select2_single\").select2({\n" +
                    "                                            placeholder: \"请选择分类\",\n" +
                    "                                            allowClear: true\n" +
                    "                                        });\n" +
                    "                                    <\/script>";
                $(t).parent().next().html(str);
                var person_price = [];
                person_price = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data[0]['person_price']+'" /></td>';

                $(t).parent().next().next().html(person_price);
                console.log(str);
            }
        });
    }
</script>
</body>
<script src="/jquery.PrintArea.js" type="text/JavaScript" language="javascript"></script>
<script>

    function single2(id,t) {
        $.ajax({
            url : '{:url("ajaxfenlei")}',
            data:{'id':id,'order_id':{:input('id')}},
        dataType:'json',
            success:function(data){
            console.log(data);
            //var str = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data+'" /></td>';
            $(t).parent().next().find('input').val(data);
        }
    });
    }
    //1服务提成 2销售提成
    function single22(id,t) {
        var shop_id = {$shop_id};
        var type = $(t).parent().prev().prev().find('select').val();
            if(type == 2){
                $.ajax({
                    url : '{:url("ajax_goods_shop_price")}',
                    data:{'goods_id':id,'shop_id':shop_id},
                    dataType:'json',
                    success:function(data){
                        console.log(data);
                        //var str = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data+'" /></td>';
                        $(t).parent().next().find('input').val(data);
                    }
                });
            }
            if(type == 1){
                $.ajax({
                    url : '{:url("ajax_goods_shop_price1")}',
                    data:{'goods_id':id,'shop_id':shop_id},
                    dataType:'json',
                    success:function(data){
                        console.log(data);
                        //var str = '<td><input name="assignor_price[]" readonly class="form-control" value="'+data+'" /></td>';
                        $(t).parent().next().find('input').val(data);
                    }
                });
            }

    }
    $('#status_2').click(function () {

        $('.service_people').hide();

    });
    $('#status_1').click(function () {

        $('.service_people').show();

    });
    $("#btnPrint").click(function(){

        $(".printArea").printArea();
    });
    $("#btnPrintFull").click(function(){
        $("body").printArea();
    });
    $('#status_4').click(function () { //是隐藏提成

        $('.dc').hide();
    });
    $('#status_3').click(function () {

        $('.dc').show();
    });

</script>

</html>
